/*/////////////////////////////////////////////////////////////////////////////////
/// An
///    ___   ____ ___ _____ ___  ____
///   / _ \ / ___|_ _|_   _/ _ \|  _ \
///  | | | | |  _ | |  | || | | | |_) |
///  | |_| | |_| || |  | || |_| |  _ <
///   \___/ \____|___| |_| \___/|_| \_\
///                              File
///
/// Copyright (c) 2008-2009 Ismail TARIM <ismail@royalspor.com> and the Ogitor Team
//
//This program is free software; you can redistribute it and/or modify it under
//the terms of the GNU Lesser General Public License as published by the Free Software
//Foundation; either version 2 of the License, or (at your option) any later
//version.
//
//This program is distributed in the hope that it will be useful, but WITHOUT
//ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
//FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
//
//You should have received a copy of the GNU Lesser General Public License along with
//this program; if not, write to the Free Software Foundation, Inc., 59 Temple
//Place - Suite 330, Boston, MA 02111-1307, USA, or go to
//http://www.gnu.org/copyleft/lesser.txt.
////////////////////////////////////////////////////////////////////////////////*/

#pragma once

namespace Ogitors
{

class OgitorExport CParticleEditor : public CNodeEditor
{
    friend class CParticleEditorFactory;
public:
    /// Returns the Factory associated with this object
	static CBaseEditorFactory *getFactory();
    /// Returns the Factory associated with this object can be overridden
	virtual CBaseEditorFactory *getFactoryDynamic();

    void                    setParticle(const Ogre::String& particle, bool display);
    Ogre::String            getParticle();
    void                    setCastShadows(const bool& value, bool display);
    bool                    getCastShadows();
    virtual void            processParameters(Ogre::NameValuePairList &params);
    /// Virtual Function that loads (Creates) underlying object 
    virtual bool            load();
    /// Virtual Function that unloads (Deletes) underlying object 
    virtual bool            unLoad();

    virtual void            getObjectProperties(Ogre::NameValuePairList &retList);
    virtual bool			setupPropertiesWnd(bool present);
    virtual void            showBoundingBox(bool bShow);
	virtual Ogre::AxisAlignedBox getAABB();
    /// Overridden by Editor Objects to Import Object Dependant Properties
    virtual void            restore(Ogre::NameValuePairList &retList);
    /// Gets the Handle to encapsulated object
    inline virtual void    *getHandle() {return static_cast<void*>(m_ParticleHandle);};

protected:
    Ogre::ParticleSystem *m_ParticleHandle;
    Ogre::Entity         *m_EntityHandle;
    Ogre::String          m_ParticleSystem;
    bool                  m_CastShadows;

	CParticleEditor();
	virtual     ~CParticleEditor() {};
	virtual bool handleCustomFunction(int BIND_ID,Ogre::String val);
};

class OgitorExport CParticleEditorFactory: public CBaseEditorFactory
{
public:
  CParticleEditorFactory();
  virtual ~CParticleEditorFactory() {};
  virtual void Init();
  virtual CBaseEditor *CreateObject(CBaseEditor **parent, Ogre::NameValuePairList &params);
  virtual Ogre::String GetPlaceHolderName() {return "scbLight_Omni.mesh";};
};

}
